package game.gfx;

public class SpriteSheet
{
	int xPos;
	int yPos;
	int width;
	int height;
	ImageReader image;
	String[][] tileData;
	String[][] pixelData;
	
	public SpriteSheet(ImageReader image)
	{
		this.image = image;
	}
	
	public String[][] getTileData(int xCoord, int yCoord)
	{
		this.xPos = xCoord * 8;
		this.yPos = yCoord * 8;
		
		int xCounter = 0;
		int yCounter = 0;
		
		tileData = new String[8][8];
			
		pixelData = image.getPixelData();
		width = image.getWidth();
		height = image.getHeight();
		
		for (int y = yPos; y < (yPos + 8); y++)
		{
			for (int x = xPos; x < (xPos + 8); x++)
			{
				tileData[xCounter][yCounter] = pixelData[x][y];
				xCounter++;
			}
			xCounter = 0;
			yCounter++;
		}
		
		return tileData;
		
	}
}